import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../layout/Layout.vue'
import Login from '../views/Login.vue'
import About from '../views/About.vue'
import Backstage from '../views/backstage/Backstage.vue'
import Parkingrecord from '../views/parkingrecord/Parkingrecord.vue'
import Charges from '../views/charges/Charges.vue'
import Policeofficer from '../views/policeofficer/Policeofficer.vue'
import Alertlist from '../views/alertlist/Alertlist.vue'
import Historyalert from '../views/historyalert/Historyalert.vue'
import Trafficuidex from '../views/trafficuidex/Trafficuidex.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/layout/backstage'
  },
  {
    path: '/layout', //布局路由
    name: 'Layout',
    component: Layout,
    children: [
      {
        path: 'backstage', //首页
        name: 'backstage',
        component: Backstage
      },
      {
        path: 'parkingrecord', //停车记录
        name: 'parkingrecord',
        component: Parkingrecord
      },
      {
        path: 'charges', //收费记录
        name: 'charges',
        component: Charges
      },
      {
        path: 'policeofficer', //警员列表
        name: 'policeofficer',
        component: Policeofficer
      },
      {
        path: 'alertlist', //警情列表
        name: 'alertlist',
        component: Alertlist
      },
      {
        path: 'historyalert', //历史警情
        name: 'historyalert',
        component: Historyalert
      },
      {
        path: 'trafficuidex', //交通指数
        name: 'trafficuidex',
        component: Trafficuidex
      },
      {
        path: 'about',
        name: 'about',
        component: About
      }
    ]
  },
  {
    path: '/login', //登陆
    name: 'login',
    component: Login
  },
]

const router = new VueRouter({
  routes
})

export default router
